//
//  LCClassificationCell.m
//  LongChain
//
//  Created by FengZi on 2018/4/7.
//  Copyright © 2018年 FengZi. All rights reserved.
//

#import "LCClassificationCell.h"

@implementation LCClassificationCell

- (void)lc_updateCellWithParameter:(id)parameter andFileCount:(NSDictionary *)serviceData {

    NSString *bgName = [NSString stringWithFormat:@"%@",parameter[@"bg"]];
    _bgImageView.image = [UIImage imageNamed:bgName];
    NSString *fgName = [NSString stringWithFormat:@"%@",parameter[@"fg"]];
    _frontImageView.image = [UIImage imageNamed:fgName];
    NSString *title = [NSString stringWithFormat:@"%@",parameter[@"title"]];
    _desTitle.text = title;
    
    if (serviceData) {
        NSString *fileCount = @"";
        if ([title isEqualToString:@"照片"]) {
            
            UIColor *photoColor = RGB(80.0f, 123.0f, 199.0f);
            _desTitle.textColor = photoColor;
            fileCount = [NSString stringWithFormat:@"%@",serviceData[@"image"]];
            _countTitle.textColor = photoColor;
            
        }else if ([title isEqualToString:@"视频"]){
            
            UIColor *videoColor = RGB(80.0f, 123.0f, 199.0f);
            _desTitle.textColor = videoColor;
            fileCount = [NSString stringWithFormat:@"%@",serviceData[@"video"]];

            _countTitle.textColor = videoColor;
            
            
        }else if ([title isEqualToString:@"文档"]){
            
            UIColor *textColor = RGB(199.0f, 153.0f, 42.0f);
            fileCount = [NSString stringWithFormat:@"%@",serviceData[@"text"]];

            _desTitle.textColor = textColor;
            _countTitle.textColor = textColor;
            
            
        }else if ([title isEqualToString:@"全部"]){
            fileCount = [NSString stringWithFormat:@"%@",serviceData[@"total"]];

            UIColor *totalColor = RGB(91.0f, 71.0f, 191.0f);
            _desTitle.textColor = totalColor;
            _countTitle.textColor = totalColor;
            
            
        }else if ([title isEqualToString:@"音乐"]){
            fileCount = [NSString stringWithFormat:@"%@",serviceData[@"audio"]];

            UIColor *audioColor = RGB(255.0f, 112.0f, 112.0f);
            _desTitle.textColor = audioColor;
            _countTitle.textColor = audioColor;
            
        }
        self.countTitle.text = fileCount;
    }
}
@end
